package com.scetop.bank;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Bank {

//    private Customer [] customer;
//    private int numOfCustomers;

    private List<Customer> customers;

//    private Customer[] customers;
//    private int numberOfCustomers;

    public Bank() {
        customers = new ArrayList<>();
//        customers = new Customer[10];
    }

    private static Bank bank = new Bank();

    public static Bank getBank() {
        return bank;
    }

    public void addCustomer(String f,String l) {
//        Customer customer = new Customer(f, l);
//        customers[numberOfCustomers] = customer;
//        numberOfCustomers++;

        customers.add(new Customer(f,l));

    }
    public int getNumOfCustomers(){
//        return numberOfCustomers;
        return customers.size();
    }
    public Customer getCustomer(int index){
//        return customers[index];
        return customers.get(index);
    }

    public Iterator<Customer> getCustomers(){
        return customers.iterator();
    }

}